import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const Login = () => import('views/login/Login.vue')
const Layout = () => import('views/layout/Layout.vue')
const Role = () => import('views/role/Role.vue')
const Error404 = () => import('views/Error404.vue')

const routes = [
    {
        path: '',
        redirect: '/login'
    },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/layout',
        component: Layout,
        children:[
            {
                path:'role',
                component:Role
            }
        ]
    },
    {
        path:'*',
        component:Error404
    }
]

const router = new VueRouter({
    routes,
    mode: 'history'
})

export default router
